﻿(function () {
    var goToAddPet = function () {
        WinJS.Navigation.navigate("/pages/addpet/addpet.html");
    }

    var goToAddVet = function () {
        WinJS.Navigation.navigate("/pages/addvet/addvet.html");
    }

    var goToHome = function () {
        WinJS.Navigation.navigate("/pages/home/home.html");
    }

    var goToStartPage = function () {
        if (Data.getPets().length!=0) {
            WinJS.Navigation.navigate("/pages/home/home.html");
        }
        else {
            WinJS.Navigation.navigate("/pages/addpet/addpet.html");
        }
    }

    WinJS.Utilities.markSupportedForProcessing(goToAddPet);
    WinJS.Utilities.markSupportedForProcessing(goToStartPage);
    WinJS.Utilities.markSupportedForProcessing(goToAddVet);
    WinJS.Utilities.markSupportedForProcessing(goToHome);

    WinJS.Namespace.define("DefaultCodeBehind", {
        goToStartPage: goToStartPage,
        goToAddPet: goToAddPet,
        goToAddVet: goToAddVet,
        goToHome: goToHome
    });
})()